﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:LunchRoller"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:LunchRoller_ViewModels_Json_JiePangResponse="clr-namespace:LunchRoller.ViewModels.Json.JiePangResponse"  
    x:Class="LunchRoller.AddOrEditPlace"
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Landscape"
    mc:Ignorable="d" d:DesignHeight="480"
    shell:SystemTray.IsVisible="False"   d:DesignWidth="728"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit">
	<phone:PhoneApplicationPage.Resources>

	</phone:PhoneApplicationPage.Resources>
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    
        <!--LayoutRoot is the root grid where all page content is placed-->
 
	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
	<phone:PhoneApplicationPage.Background>
		<StaticResource ResourceKey="BackgroudBrush"/>
	</phone:PhoneApplicationPage.Background>
 
    
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" BackgroundColor="{StaticResource ApplicationBarBGColor}" ForegroundColor="{StaticResource ApplicationBarFGColor}">
            <shell:ApplicationBarIconButton IconUri="/Images/ApplicationBar/appbar.check.rest.png" Text="OK"/>
            <shell:ApplicationBarIconButton IconUri="/Images/ApplicationBar/appbar.cancel.rest.png" Text="Cancel"/>
   
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <Grid Background="{StaticResource BackgroudBrush}">
<TextBlock Grid.Row="1" TextWrapping="Wrap"  HorizontalAlignment="Right" VerticalAlignment="Bottom"  Foreground="Red" Name="_errorMessage" Text="{Binding AddOrEditPlaceErrorMessage}"></TextBlock>
        <controls:Pivot Name="rootPivot" Title="艰难决定:午饭吃啥"  SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"   Foreground="{StaticResource ForeColor}"  >


            <controls:PivotItem Header="手动输入">
                <Grid x:Name="LayoutRoot"  DataContext="{Binding AddingOrEditingPlace}">

                    <!--ContentPanel - place additional content here-->
                    <ListBox x:Name="listBox" Grid.Row="1">
                    	<Grid x:Name="ContentPanel" Grid.Row="1" Width="{Binding ActualWidth, ElementName=listBox}" Height="{Binding ActualHeight, ElementName=listBox}">
                    		<Grid.RowDefinitions>
                    			<RowDefinition Height="0.05*" MinHeight="40" />
                    			<RowDefinition Height="0.10*" MinHeight="70" />
                    			<RowDefinition Height="0.05*" MinHeight="40"/>
                    			<RowDefinition Height="0.34*" MinHeight="70" />
                    			<RowDefinition Height="0.16*"/>
                    		</Grid.RowDefinitions>
                    		<TextBlock Margin="14,10,0,0" Foreground="{StaticResource ForeColor}" ><Run Text="进餐地点"/></TextBlock>
                    		<TextBox  Grid.Row="1" TextWrapping="NoWrap" Text="{Binding Name, Mode=TwoWay}" BorderBrush="{StaticResource ItemTransBackground}" Background="{StaticResource ItemTransBackground}" Foreground="{StaticResource DarkBorderBrush}" />
                    		<TextBlock Margin="14,10,0,-1" Grid.Row="2" Foreground="{StaticResource ForeColor}" ><Run Text="说明"/></TextBlock>
                    		<TextBox  Grid.Row="3" TextWrapping="Wrap" Text="{Binding Description, Mode=TwoWay}" Margin="0,0,0,26.5" BorderBrush="{StaticResource ItemTransBackground}" Foreground="{StaticResource DarkBorderBrush}" Background="{StaticResource ItemTransBackground}"/>
                    	</Grid>
                    </ListBox>

                </Grid>

            </controls:PivotItem>
            <controls:PivotItem Header="选自街旁">
                <Grid>

                	<Grid.RowDefinitions>
                		<RowDefinition Height="0.834*"/>
                		
                		<RowDefinition Height="50"/>
						<RowDefinition Height="20"/>
                	</Grid.RowDefinitions>
                	<ListBox Background="{StaticResource ItemTransBackground}"  ItemsPanel="{StaticResource WarpItemsPanelTemplate}" ItemsSource="{Binding NearByPlacesJiePang}" >
                		<ListBox.ItemTemplate>
                			<DataTemplate>
<Border BorderThickness="1" Padding="8" BorderBrush="#ffffffff" CornerRadius="15" Margin="5"  Background="{StaticResource ItemTransBackground}" Opacity="1" Canvas.ZIndex="-1" Width="430">
	                					<Button Style="{StaticResource SmallTextButton}" BorderThickness="0" Click="JiePangItem_Click" >		<Grid Height="100" Margin="-1,0">
	                								<Grid.RowDefinitions>
	                									<RowDefinition Height="60"/>
	                									<RowDefinition Height="0.73*"/>
	                								</Grid.RowDefinitions>	
			
				<TextBlock Text="{Binding Path=Name}" Margin="14,0,0,0"  FontSize="40" Grid.RowSpan="1" Grid.Row="0"/>
				<TextBlock Text="{Binding Path=Description}" Margin="5"  FontSize="17" Width="390" Grid.Row="1"/>	
				
				
			</Grid>	</Button></Border>
								         			
							</DataTemplate>          		
						</ListBox.ItemTemplate>
                		
                	<!--	<LunchRoller_ViewModels_Json_JiePangResponse:Place addr="地址" guid="" has_surprise="True" has_event="True" link="xxxx" name="名称1"/>
							<LunchRoller_ViewModels_Json_JiePangResponse:Place addr="地址" guid="" has_surprise="True" has_event="True" link="xxxx" name="名称2"/>
								<LunchRoller_ViewModels_Json_JiePangResponse:Place addr="地址" guid="" has_surprise="True" has_event="True" link="xxxx" name="名称3"/>-->
                	</ListBox>            
					<Grid Grid.Row="1" Width="300" Margin="0" d:LayoutOverrides="Width, GridBox" HorizontalAlignment="Center">
						                	<Grid.ColumnDefinitions>
                		<ColumnDefinition Width="0.1*"/>
                		<ColumnDefinition Width="0.05*"/>
                		<ColumnDefinition Width="0.1*"/>
                	</Grid.ColumnDefinitions>
					<Button Style="{StaticResource SmallTextButton}" BorderThickness="1" Content="更多" Command="{Binding GetNearbyByJiePangCommand}" Foreground="{StaticResource ForeColor}" BorderBrush="{StaticResource ForeColor}"/><Button Grid.Column="2" Style="{StaticResource SmallTextButton}" BorderThickness="1" Content="清除" Foreground="{StaticResource ForeColor}" BorderBrush="{StaticResource ForeColor}" Command="{Binding ClearNearbyByJiePangCommand}"/>
					</Grid>
					
				</Grid>
             </controls:PivotItem>
        </controls:Pivot>
        <ProgressBar Height="10"  VerticalAlignment="Center" IsIndeterminate="{Binding NearByPlacesJiePang.IsInvoking}" Background="#0029B9FF"/>
    </Grid>
 
</phone:PhoneApplicationPage>
